package com.heima.admin.controller.v1;

import com.heima.admin.service.AdAuthService;
import com.heima.apis.user.IUserRealnameClient;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.AuthDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/api/v1/auth")
public class AdAuthController {
    @Autowired
    private IUserRealnameClient iUserRealnameClient;

    @Autowired
    private AdAuthService adAuthService;

    /**
     * 实现Amidn端用户审核的分页查询认证列表
     *
     * @param dto
     * @return
     */
    @PostMapping("/list")
    public ResponseResult list(@RequestBody AuthDto dto) {
        return adAuthService.list(dto);
    }

    /**
     * 实现Amidn端用户审核的审核失败
     *
     * @param dto
     * @return
     */
    @PostMapping("/authFail")
    ResponseResult authFail(@RequestBody AuthDto dto) {
        return adAuthService.authFail(dto);
    }

    /**
     * 实现Amidn端用户审核的审核成功
     *
     * @param dto
     * @return
     */
    @PostMapping("/authPass")
    public ResponseResult authPass(@RequestBody AuthDto dto) {
        return adAuthService.authPass(dto);
    }
}
